package com.yunatt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yunatt.model.EnrollInfoEntity;
import com.yunatt.model.PersonEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface PersonMapper extends BaseMapper<PersonEntity> {
    List<PersonEntity> getPersonAll();

    List<PersonEntity> selectByName(@Param("name") String vl);

    List<Map<String, Object>> selectPersonByName(@Param("name") String vl);

    @Select("select * from enrollinfo where enroll_id=#{id} and backupnum=50  order by id desc  limit 1" )
    EnrollInfoEntity selectEnrollById(@Param("id") Long id);
    @Delete("delete from enrollinfo where enroll_id=#{id} ")
    void deleteByEnrollId(@Param("id")Long enrollId);

    @Select("Select * from person")
    List<PersonEntity> selectAll();
}
